﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>旅易中国分销联盟</title>
<style type="text/css">
body,dl,dd,dt{ padding:0; margin:0; color:#767676; font-size:12px;}
#calendar { width:304px; height:183px; overflow:hidden; background-color:#fff; clear:both;}
#calendar .t{ height:24px; clear:both;}
#calendar .t .l{ width:4px; height:24px; font-size:0; background:url(../images/d/d_t_l.gif) no-repeat; float:left;}
#calendar .t .c{ width:296px; height:24px; background:url(../images/d/d_t_c.gif) repeat-x; float:left;}
.c .d1,.c d2{ width:50%; height:24px; line-height:24px; float:left}
.c .d1 a.pre,.c .d1 a.pre:hover{ display:inline; width:10px; height:10px; margin-left:28px; margin-top:6px; background:url(../images/d/d_t_pre.gif) no-repeat; float:left;}
.c .d1 span{ display:block; float:left; margin-left:7px; line-height:24px; font-weight:bold; color:#131313; font-family:Arial;}
.c .d2 span{ display:block; float:left; margin-left:35px; line-height:24px; font-weight:bold; color:#131313; font-family:Arial;}
.c .d2 a.next,.c d2 a.next:hover{ display:inline; width:10px; height:10px; margin-left:7px; margin-top:6px; background:url(../images/d/d_t_next.gif) no-repeat; float:left;}
.c .d2 a.close,.c d2 a.close:hover{ display:inline; width:11px; height:11px; margin-left:22px; margin-top:6px;  background:url(../images/d/d_close.gif) no-repeat; float:left}
#calendar .t .r{ width:4px; height:24px; font-size:0; background:url(../images/d/d_t_r.gif) no-repeat; float:right;}
#calendar .calen{ height:153px; border-left:1px solid #aaa; border-right:1px solid #aaa; clear:both; }
.calen dl{ display:inline; margin-top:8px; height:140px; background-color:#fff; float:left; width:147px; margin-left:3px; } .calen dl dt{ height:24px;} 
.calen dl dt b{ display:block; width:20px; height:24px; text-align:center; line-height:24px; float:left; color:#777;} dl.w1{ border-right:1px solid #aaa;}
.calen dl dd span{ display:block; width:20px; height:20px; text-align:center; font-family:Arial; color:#76777b; line-height:20px; float:left;}
.calen dl dd span a{ display:block; width:20px; height:20px; font-family:Arial; text-align:center; text-decoration:none; line-height:20px; color:#000; font-weight:bold; float:left;}
.calen dl dd span a:hover { display:block; background-color:#1f95c5; font-family:Arial; text-align:center; text-decoration:none; color:#fff; font-weight:bold; }
.calen dl dd span a.current,.calen dl dd span a.current:hover{ display:block; width:20px; font-family:Arial; text-align:center; text-decoration:none; height:20px; background-color:#777; line-height:20px; color:#fff; font-weight:bold; float:left;}
#calendar .foot{ height:5px; background:url(../images/d/d_b_bg.gif) no-repeat; font-size:0;}
</style>
<script language=javascript>
<!--//
var str='',i,j,yy,mm,openbound,callback;
var fld1,fld2;
var wp=window.parent;
var cf=wp.document.getElementById("CalFrame");
var fld,curday,today=new Date();
var n_textdate,mmm,ddd;
mmm="";
today.setHours(0);today.setMinutes(0);today.setSeconds(0);today.setMilliseconds(0);
function parseDate(s)//解析日期
{
	var reg=new RegExp("[^0-9-]","")
	if(s.search(reg)>=0)return today;
	var ss=s.split("-");
	if(ss.length!=3)return today;
	if(isNaN(ss[0])||isNaN(ss[1])||isNaN(ss[2]))return today;
	return new Date(parseFloat(ss[0]),parseFloat(ss[1])-1,parseFloat(ss[2]));
}
function resizeCalendar(){cf.width=304;cf.height=183;}//设定日历宽高
function initCalendar()//初始化
{
	curday=today;
	if(fld1&&fld1.value.length>0){curday=parseDate(fld1.value);}
	if(fld2&&fld2.value.length>0){curday=parseDate(fld2.value);}	
	drawCalendar(curday.getFullYear(),curday.getMonth());
}
function drawCalendar(y,m)//画日历
{
	var yzzz = y;
	var mzzz = m+1;
	var x=new Date(y,m,1),mv=x.getDay(),d=x.getDate(),de;
	yy=x.getFullYear();mm=x.getMonth();
	document.getElementById("yyyymm").innerHTML=yy+"."+(mm+1>9?mm+1:"0"+(mm+1));
	//清空日历
	for(var i=1;i<=mv;i++)
	{
		de=document.getElementById("d"+i);
		de.innerHTML="";
	}
	//画日历
	while(x.getMonth()==mm)
	{
		de=document.getElementById("d"+(d+mv));
		if(x.getTime()==today.getTime())   //当天日期
		{
			de.innerHTML="<a class='current' href=javascript:setDate("+d+","+mm+","+yy+");>"+d+"</a>";
		}
		else if(x.getTime()<today.getTime())  //之前的日期
		{
			if(openbound){
				de.innerHTML="<a href=javascript:setDate("+d+","+mm+","+yy+");>"+d+"</a>";
			}else{
				de.innerHTML=""+d+"";
			}
		}	
		else
		{
			de.innerHTML="<a href=javascript:setDate("+d+","+mm+","+yy+");>"+d+"</a>"; 
		}
		x.setDate(++d,mm,yy);
	}
	while(d+mv<=42)
	{
		de=document.getElementById("d"+(d+mv));
		de.innerHTML="";
		d++;
	}
	var xzzz=new Date(yzzz,mzzz,1),mvzzz=xzzz.getDay(),dzzz=xzzz.getDate(),dezzz;
	yyzzz=xzzz.getFullYear();mmzzz=xzzz.getMonth();
	document.getElementById("yyyymmzzz").innerHTML=yyzzz+"."+(mmzzz+1>9?mmzzz+1:"0"+(mmzzz+1));
	//清空日历
	for(var i=1;i<=mvzzz;i++)
	{
		dezzz=document.getElementById("dzzz"+i);
		dezzz.innerHTML="";
	}
	//画日历
	while(xzzz.getMonth()==mmzzz)
	{
		dezzz=document.getElementById("dzzz"+(dzzz+mvzzz));
		if(xzzz.getTime()==today.getTime())
		{
				dezzz.innerHTML="<a class='current'  href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+");>"+dzzz+"</a>";
		}
		else if(xzzz.getTime()<today.getTime())
		{
				if(openbound){dezzz.innerHTML="<a href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+");>"+dzzz+"</a>";}
				else{dezzz.innerHTML=""+dzzz+"";}
		}	
		else
		{
			dezzz.innerHTML="<a href=javascript:setDate("+dzzz+","+mmzzz+","+yyzzz+");>"+dzzz+"</a>";
		}
		xzzz.setDate(++dzzz,mmzzz,yyzzz);
	}
	while(dzzz+mvzzz<=42)
	{
		dezzz=document.getElementById("dzzz"+(dzzz+mvzzz));
		dezzz.innerHTML="";
		dzzz++;
	}
	//new!!
}
function setDate(d,mm,yy)//设置日期
{
	wp.hideCalendar();
	mmm=mm+1;
	var dstr=yy+"-"+(mmm)+"-"+d;
	fld1.value=dstr;
	fld1.focus()
	if(!n_textdate){
		if(callback&&callback.length>0){eval("wp."+callback+"(\""+dstr+"\")");}
	}else{		
		wp.showCalendar(n_textdate,'',callback,fld1.id);			
	}	
}
//-->
</script>
</head>

<body onLoad="resizeCalendar();">
<div id="calendar">
	<div class="t">
        <div class="l"></div>
        <div class="c">
        	<div class="d1"><a id="prev" href="javascript:drawCalendar(yy,mm-1);" class="pre" hidefocus="true"></a><span id="yyyymm"></span></div>
            <div class="d2"><span id="yyyymmzzz"></span><a id="next" href="javascript:drawCalendar(yy,mm+1);" class="next" hidefocus="true"></a><a href="javascript:wp.hideCalendar();" class="close" hidefocus="true"></a></div>
        </div>
        <div class="r"></div>
    </div>
    <div class="calen">
        <dl class="w1">
        	<dt><b>日</b><b>一</b><b>二</b><b>三</b><b>四</b><b>五</b><b>六</b></dt>
            <dd>
            <script language=javascript>
			<!--//
			var str = "";
			for(i=0;i<6;i++)
			{	
				for(j=1;j<=7;j++)str+="<span id=d"+(i*7+j)+"></span>";
			}
			document.write(str);
			//-->
			</script>
            </dd>
        </dl>
        <dl class="w2">
        	<dt><b>日</b><b>一</b><b>二</b><b>三</b><b>四</b><b>五</b><b>六</b></dt>
            <dd><script language=javascript>
        	var str = "";
			<!--//
			for(i=0;i<6;i++)
			{
				for(j=1;j<=7;j++)str+="<span id=dzzz"+(i*7+j)+"></span>";
			}
			document.write(str);
			//-->
				</script></dd>
        </dl>
    </div>
    <div class="foot"></div>
</div>
<script language=javascript>
<!--//
var bCalLoaded=true;
//-->
</script>
</body>
</html>
